#include "stdafx.h"
#include "Aspector.h"
#include "IAdvice.h"

void CAspector::AddAdvice(IAdvice* advice)
{
	advices.insert(std::make_pair(advice->GetPriority(),advice));
}

void CAspector::RemoveAdvice(IAdvice* advice)
{
	CAdviceCollection::iterator pIt = advices.find(advice->GetPriority());
	while ( pIt!= advices.end() )
	{
		if ( (*pIt).second == advice )
		{
			advices.erase(pIt);
			return;
		}
		pIt++;
	}
}

